import Vue from 'vue'
import Router from 'vue-router'
// 引入组件
import Competition from '../pages/Competition'
import Class from '../pages/Class'
import Plan from '../pages/Plan'
import Question from '../pages/Question'
import Resource from '../pages/Resource'
import Login from '../pages/Login'
import Index from '../pages/Index'
import CompetitionEdit from '../pages/CompetitionEdit'

Vue.use(Router)

export default new Router({
  routes: [
    // 登陆路由
    {
      path: '/login',
      name: 'login',
      component: Login
    },
    // 主页面以及它的子路由
    {
      path: '/',
      name: 'index',
      component: Index,
      children: [
        {
          path: '/competition',
          name: 'competition',
          component: Competition
        },
        {
          path: '/competitionEdit',
          name: 'competitionEdit',
          component: CompetitionEdit
        },
        {
          path: '/class',
          name: 'class',
          component: Class
        },
        {
          path: '/plan',
          name: 'plan',
          component: Plan
        },
        {
          path: '/question',
          name: 'question',
          component: Question
        },
        {
          path: '/resource',
          name: 'resource',
          component: Resource
        }
      ]
    }
  ]
})
